The Midgard RPC layer.

The midgard transport is a generic simple RPC layer, 

it sends out. requests for 
table = normally database table
id = the key value to list or get.
depth = the request type.


the valid depths are
0=get the object
1=list all objects below this.
2=save object
3=create object
4=delete object
5=(internal - was test authentication now mostly obsolete)
6=delete an object and all items below it.
8=upload an image/file
99=get a raw image/file


when uploading, the system expects all data in a flat array 
$new["key"] = value.



The midgard details viewer uses an object associated with each table element to decide 

get_defs - 
    All the items that can be edited = and displayed in the details form.
    the values are 
        STR/CDATA = text.
        tablename = a reference to an object in another table.
        UTIME = unix time stamp 
        
get_title -
    The objects descriptive / human readable title
get_icon_name
    The objects icon (from /xpm)
has_children
    Not currently used - children is defined currently by the existince of icon_open.xpm in /xpm
get_menu_items
    Used by the Bookmark browser to define what appears on the popup menu
get_action
    open,browse - if pressing on the object fires load_document and/or browse_document
    browse is used by the directory browser only at present
get_id
    normally returns $this->id, but can be used to define different keys on which to browse.
get_filter
    normally returns the sitegroup, used by popups/lists etc. to find the sg__table&id="?????"



The Details editor (midgard module)
    loads the associated glade file, loops through the defs.
    and fills in dialogs following these rules.
        Text, Entry boxes and Labels
            Just puts text into the boxes.
        Popups/Pulldown menus
            Creates a call on the table specified with the prefix sg__
            The id is the midgard sitegroup id (eg. a filter)
            It then fills the table in with the results and selects the matching item.
        
        Calendars : TODO!
            
        List boxes:
            Multiple select entries:
            assumes that a result is an array of items? == the currently selected 
            obtains all available obtions by calling 
                table=sg__(mapped table), id = ??? was sitegroup, now is?
                
                example - axisnames is a map to list of 
                product_variants (table = omphp_things,filter='xbrh0003')
            
            
            